package it.univaq.mwt.business.impl;

import it.univaq.mwt.business.UtenteService;
import it.univaq.mwt.business.model.Utente;

import javax.annotation.Resource;
import javax.ejb.Remote;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;



@Stateless
@Remote(UtenteService.class)
public class EJBUtente implements UtenteService {
	
	

	@PersistenceContext(unitName="Yop-domain")
	private EntityManager em;

	
	@Resource
	private SessionContext etx;
	
	public EJBUtente() {
		
	}

	@Override
	public Utente findUtenteById(int id) {
		Utente user = em.find(Utente.class, id);
		return user;
	}

}
